import * as types from '../constants/ActionTypes';
export default function recharge(state = [], action = {}) {
    const {
        type, payload
    } = action;
    switch (type) {
        case types.FETCH_RECHARGES:
            return { ...payload };
        case types.FETCH_RECHARGES_SUCCESS:
            return [...payload.results];
        case types.FETCH_RECHARGES_FAILURE:
            return [];
        default:
            return state;
    }
}